/**
 * @(#)CityUtils.java, 2010-5-20. 
 * 
 * Copyright 2010 Youdao, Inc. All rights reserved.
 * YOUDAO PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.rsstuan.utils;

/**
 *
 * @author guosq
 *
 */
public class CityUtils {
    
	public static final String QUANGUO = "全国";
	
	public static final String BEIJING= "北京";
	
	public static final String SHANGHAI = "上海";
	
	public static final String WUHAN = "武汉";
	
	public static final String GUANGZHOU = "广州";
	
	public static final String NANJING = "南京";
	
	public static final String XIAMEN = "厦门";
	
	public static final String FUZHOU = "福州";
	
	public static final String DEFAULT_CITY = BEIJING;
	
	private static String[] allCities = {BEIJING, SHANGHAI, WUHAN, GUANGZHOU, NANJING, XIAMEN, FUZHOU};
	
    public static String getCityString(String idStr) {
       if (idStr != null) {
    	   try {
    		   int cityid = Integer.parseInt(idStr);
    		   return getCity(cityid);
    	   } catch (Exception e) {}
       }
       return DEFAULT_CITY;
    }

    public static String getCity(int cityid) {
    	switch (cityid) {
    	case 0:
    		return QUANGUO;
    	case 1:
    		return BEIJING;
    	case 2:
    		return SHANGHAI;
    	case 3:
    		return GUANGZHOU;
    	case 4:
    		return WUHAN;
    	case 5:
    		return NANJING;
    	case 6:
    		return XIAMEN;
    	case 7:
    		return FUZHOU;
    	default:
    		return DEFAULT_CITY;
    	}
    }

	public static String[] getAllCities() {
		return allCities;
	}
}
